<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!--相关分类-->
<div class="typelist">
	<div class="tit" style="margin: 11px 0 20px 0;">
        <h2>相关分类</h2>
     </div>
	<div class="typeone">
		<ul>
            <li><a href="${pageContext.request.contextPath }/news/">新闻</a></li>
            <li><a href="${pageContext.request.contextPath }/adopt/">领养</a></li>
            <li><a href="${pageContext.request.contextPath }/knowledge/">知识</a></li>
        </ul>
	</div>
</div>

<!-- 热门阅读--> 
<div class="hotread">
	<div class="read-title">
		<h2>热门阅读</h2>
	</div>
	<ul id="remenyuedu">
		<!-- 
		<li>
            <h3>
            	<a href="" target="_blank" title="">当残疾动物装上3D打印假肢 其它动物都哭了</a>
            </h3>
            <div class="pic">
            	<a href="" target="_blank" title="当残疾动物装上3D打印假肢 其它动物都哭了">
            		<img src="${pageContext.request.contextPath }/images/client/xw/1.jpg" width="90" height="90" alt="当残疾动物装上3D打印假肢 其它动物都哭了">
            	</a>
            </div>
            <p>人们经常过度的关心自身，而忽略了与人类共同生活在地球上动物们，其实他们和人类一样拥有自己的...</p>
        </li>
		 -->
	</ul>
</div>
<script src="${pageContext.request.contextPath }/jquery/jquery.min.js"></script>
<script type="text/javascript">
	window.onload=function (){
			//热门阅读
			var index = layer.load(2, {time: 20000}); //缓冲3秒
			$.post("/dogstore/news/remenyuedu",
				{
					size:2
				},
				function (result){
					if(result != null){
						var list = JSON.parse(result);
						$("#remenyuedu").html("");
						layer.close(index);
						$.each(list,function(i,item){
							//console.log(item.title);
							$("#remenyuedu").append(""+
								"<li>"+
						            "<h3>"+
						            	"<a href='/dogstore/news/detail?key="+item.id+"' target='_blank' title='"+item.title+"'>"+item.title+"</a>"+
						            "</h3>"+
						            "<div class='pic'>"+
						            	"<a href='/dogstore/news/detail?key="+item.id+"' target='_blank' title='"+item.title+"'>"+
						            		"<img src='"+item.imgurl+"' width='90' height='90' alt='"+item.title+"'>"+
						            	"</a>"+
						            "</div>"+
						            "<p>"+item.text+"</p>"+
						        "</li>"
							);
						});	
					}else{
						layer.msg("右边出错! 找prince!",{shift:6});
					}
				}
			);	
			
		};  	
</script>
</html>
